<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%@ include file="/commons/jsp/taglibs.jsp"%>
<%@taglib uri="http://www.framework.com/taglib" prefix="frame"%>
  <head>
	<title>公共平台 </title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<!-- 样式文件的引入 -->
	<link href="${ctx}/commons/css/style.css" rel="stylesheet" type="text/css"/>
	<link rel="stylesheet" type="text/css" href="${ctx}/commons/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="${ctx}/commons/themes/icon.css">
	<!-- jqueryUI JS文件的引入 -->
	<script type="text/javascript" src="${ctx}/commons/js/jquery-1.8.0.min.js"></script>
	<script type="text/javascript" src="${ctx}/commons/js/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="${ctx}/commons/js/easyui-extends-validate.js"></script>
	<!-- jqueryUI国际化 -->
	<script type="text/javascript" src="${ctx}/commons/js/easyui-lang-zh_CN.js"></script>
	<!-- 开发使用的公用js方法 -->
	<script type="text/javascript" src="${ctx}/commons/js/common.js"></script>
	<!-- 开发国际化的引用，主要完成后台信息在前台提示的国际化，一定要放在最后 -->
	<script type="text/javascript">var ctx = '${ctx}';var actionExt = "action";var i18n = new Object();</script>
	<script src="${ctx}/commons/js/i18n/message_zh_CN.js" type="text/javascript"></script>
  </head>
  
  <body>
    <div class="easyui-layout" data-options="fit:true,border:false" >
			<div data-options="region:'north',border:false" style="padding: 4px;height: 80px;overflow: hidden;">
			<div class="easyui-panel" data-options="fit:true,border:true" >
			<div  class="queryContent">
				<form name="searchProjectsForm" id="searchProjectsForm" method="post" action="" style="display: none; ">
				<table class="queryTable" >
					<tbody>
						<tr>
							<th >项目名称</th>
							<td width="10%">
								<input id="name" class="easyui-validatebox" type="text" name="name"  maxlength="50" style="width:120px;height: 15px;"/>
							</td>
							<th>项目编号</th>
							<td>
							 	<input id="code" class="easyui-validatebox" type="text" name="code"  maxlength="20" style="width:120px;height: 15px;"/>
							</td>
							<th >项目类型</th>
							<td width="10%">
								<select class="easyui-combobox" name="catagoryId" style="width:120px;height: 25px;" maxlength="20" data-options="">
									<option value="">--请选择--</option>
									<c:forEach items="${projectTypeList}" var="type">
										<option value="${type.id}">${type.name}</option>
									</c:forEach>
								</select>
							</td>
							<!-- 
								<th >资金来源</th>
							<td>
							 	<select id="moneySource" style="width:120px" class="easyui-combobox" name="moneySource">
							 		<option value="">--请选择--</option>
									<c:forEach items="${frame:dictChildren('moneySource')}" var="type">
										<option value="${type.value}">${type.name}</option>
									</c:forEach>
								</select>
							</td>
							 --> 
							<th  >状态</th>
							<td>
							 	<select id="status" style="width:120px;height: 25px;" class="easyui-combobox" name="status">
							 		<option value="">--请选择--</option>
									<c:forEach items="${frame:dictChildren('proj_status')}" var="type">
										<option value="${type.value}">${type.name}</option>
									</c:forEach>
								</select>
							</td>
						</tr>
						<tr>
							<th>创建时间</th>
							<td>
								<input id="startTime" class="easyui-datebox" type="text" name="startTime"  data-options="validType:['dateTimeLessCompare[\'stopTime\']']" maxlength="20" style="width:120px;height: 25px;"/>-<input id="stopTime" class="easyui-datebox" type="text"  data-options="validType:['dateTimeMoreCompare[\'startTime\']']" name="stopTime" maxlength="20" style="width:120px;height: 25px;"/>
							</td>
							<th>开标时间</th>
							<td>
							 	<input id="startTime" class="easyui-datebox" type="text" name="bidTime"  data-options="validType:['dateTimeLessCompare[\'stopTime\']']" maxlength="20" style="width:120px;height: 25px;"/>-<input id="stopTime" class="easyui-datebox" type="text"  data-options="validType:['dateTimeMoreCompare[\'startTime\']']" name="bidStopTime" maxlength="20" style="width:120px;height: 25px;"/>
							</td>
							<!-- 
							<th>预算金额(元)</th>
							<td>
							 	<input id="startMoney" class="easyui-validatebox" type="text" name="startMoney"  data-options="validType:['rangeLessCompare[\'endMoney\']']" maxlength="20" style="width:120px"/>-<input id="endMoney" class="easyui-validatebox" type="text"  data-options="validType:['rangeMoreCompare[\'startMoney\']']" name="endMoney" maxlength="20" style="width:120px"/>
							</td>
							-->
							<th></th>
							<td align="right" colspan="3">
								<a href="javascript:void(0);" class="easyui-linkbutton" id="searchProjects" iconcls="icon-search" plain="true">查询</a>
								<a href="javascript:void(0);" class="easyui-linkbutton" id="resetsearchProjects" iconcls="icon-reset" plain="true">清空</a>
							</td>
						</tr>
					</tbody>
				</table>
				</form>
			</div>
			</div>
			</div>
			<div data-options="region:'center',border:false" style="padding: 4px;">
		    <table id="listProjectsTable" class="easyui-datagrid" 
				data-options="singleSelect:false,toolbar:'#goodstb',method:'post',rownumbers:true,fit:true,fitColumns:true,border:true,
					pagination:true,multiSort:true,remoteSort:true,striped:true,onLoadSuccess:function(data){$('#'+projectsParamObj.searchID).attr('disabled',false);},
					url:'${ctx}/business/projectNb/list?roleId=centerAuditor'"}>
				<thead>
					<tr>
						<th data-options="field:'name',width:170,title:'项目名称',sortable:true" align="center"></th>
						<th data-options="field:'code',width:90,title:'项目编号',sortable:true" align="center"></th>
						<th data-options="field:'catagoryName',width:80,title:'项目类型',sortable:true" align="center"></th>
						<th data-options="field:'buyName',width:120,title:'采购人',sortable:true" align="center"></th>
						<th data-options="field:'manageName',width:100,title:'项目负责人',sortable:true" align="center"></th>
						<th data-options="field:'createTime',width:100,title:'创建时间',sortable:true" align="center"></th>
						<th data-options="field:'bidStartTime',width:80,title:'开标时间 ',sortable:true" align="center"></th>
						<th data-options="field:'statusName',width:80,title:'状态',sortable:true" align="center"></th>
						<th data-options="field:'operation',width:160,title:'操作'" align="center"></th>
				</tr>
				</thead>
			</table>
			
			<!----------------------- wei start --------------------->
			<!--导出Excel -->
			<input type="hidden" id="excel_error" value="${requestScope.excel_error }"/>
			<script type="text/javascript">
		    	//导出
				function excelexport(){
					$("form").attr("action","${ctx}/business/projectmanage/export")
					$("form").submit();

					var val=$("#excel_error").val();
					if(val!=""){//不为空提示错误消息
						 top.$.messager.alert("操作提示", val,"error");  
					}
				}
				
		    </script>
			<!----------------------- wei end --------------------->		
		</div>
	</div>
	<div id="bindPicDialog"></div>
	<div id="selPicDialog"></div>
	<div id="noCompetReasonDialog"></div>
	<div id="projectPause"></div>    
</body>
	<script type="text/javascript">
		//初始化表格对应的js对象
		var projectsParamObj;
		$(function() {
			//初始化表格对象数据
			projectsParamObj = new initParams(
					{
						paramObjName : 'projectsParamObj',//表格对应的实体对象名称，好区分多个表格情况下的对象
						tableId:'listProjectsTable',
						addDataFormId:'addProjectsDataForm',
						showDialogId:'firstLevelDialog',
						searchID:'searchProjects',
						resetSearchID:'resetsearchProjects',
						searchFormID:'searchProjectsForm',
						updateUrl:"${ctx}/business/projectmanage/input?projectId=",
						deleteUrl:'${ctx}/business/projectmanage/remove',
						addDialogWidth:700,
						addDialogHeight:520,
						ctx:'${ctx}',
						addDialogTitle:'采购项目信息'
					});
			//初始化查询
			init(projectsParamObj);
		});
		
		/**
		 * 操作按钮处理
		 * @param {Object} value
		 * @param {Object} row
		 * @param {Object} index
		 */
		function getOptionsBtn(value, row, index){
			return btnsHtml +"</span>";
		}

		 
	 	/**
		 *编制审核校验
		 **/
		 function auditInput(id,type){
			 debugger;
			 $.ajax({
					type: "POST",
					timeout:20000,
					url:  "${ctx}/business/projectmanage/buyer/validateBuySure",
					success: function(data){
						if(data){
							validateTimeOk(id,type);				
						}else{
							top.$.messager.alert('提示',"当前时间已超过16:30,无法进行确认！",'error');
						}
					},
					error: function(res){
						top.$.messager.alert('提示',i18n.requestError,'error');
					}
			});
		 }

		/**
		*项目审核页面
		*/
		function validateTimeOk(id){
			top.$('#firstLevelDialog').dialog({
	 			title:"项目审核",  
			    iconCls:'icon-view',
			    width: '600',    
			    height: '300',    
			    closed: false,    
			    inline : true,
			    cache: false,    
			    href: "${ctx}/business/projectNb/centerAuditor/auditInput?projectId="+id,   
			    modal: true,
				extractor : function(data){
					if($.trim(data) == "unLogin"){
						var msn = ''||i18n[''];
						msn = msn||i18n[data];
						if(msn != undefined){
							top.$.messager.alert('提示',msn,'info',function(){top.location='${ctx}/user-login-sys-new/loginPwd';});
							return '';
						}
					}
					return data;
				},
			    buttons : [{text:'提交',
			            id:'commitEntityBt',
						iconCls:'icon-ok',
						handler:function(){
							//获取表单数据
							var cancelReason=top.$("#cancelReason").val();
							if(cancelReason==""&&!top.$("#auditPass").is(':checked')){
								top.$.messager.alert("提示",'请输入原因!',"error");
								return;
							}
							loadinginfo();//显示加载框
							top.$('#commitEntityBt').linkbutton('disable');
								$.ajax({
									type : "post",
									url : "${ctx}/business/projectNb/centerAuditor/approve?r="+new Date().getTime(),
									data : top.$("#projectsDataForm").serialize(),
									success : function(data){
										debugger
										top.$('#secondtLevelDialog').dialog('close');//隐藏加载框
										if(data=="saveSuccess"){
											top.$.messager.alert("提示",'提交成功','info',function(){
												$('#listProjectsTable').datagrid('reload');
												$('#listNBProjectsTable').datagrid('reload');
												top.$('#firstLevelDialog').dialog('close');
											});
										}else if(data=="postbankfaill"){
											top.$.messager.alert('提示',"推送投标保证金信息至银行失败，请联系系统管理员！",'error',function(){
												$('#listProjectsTable').datagrid('reload');
												$('#listNBProjectsTable').datagrid('reload');
												top.$('#firstLevelDialog').dialog('close');
											});
										}else if(data =="false"){ 
											top.$.messager.alert('提示',"当前时间已超过16:30,无法进行确认！",'error');
										}else{
											top.$.messager.alert("提示",'提交失败!',"error");
										}
									},
									error : function(data){
										top.$('#secondtLevelDialog').dialog('close');//隐藏加载框
										top.$.messager.alert("提示",'提交失败!',"error");
									}
								});
							}
						}
					,{
						text:'取消',
						iconCls:'icon-cancel',
						handler:function(){
							top.$('#firstLevelDialog').dialog('close');
						}}]
			});
			top.$('#firstLevelDialog').dialog("center");
		}
		
		 /*暂停流程*/
		 function projectPause(id,category){   
		    top.$('#firstLevelDialog').dialog({
			 			title:"暂停流程",  
					    iconCls:'icon-view',
					    width: '865',    
					    height:'325',    
					    closed: false,    
					    inline : true,
					    cache: false,    
		               href: "${ctx}/business/projectPause/leader/prjectPauserPage?projectId="+id+"&category="+category,
					    modal: true,
					    close: afterClosed,
						extractor : function(data){
							if($.trim(data) == "unLogin"){
								var msn = ''||i18n[''];
								msn = msn||i18n[data];
								if(msn != undefined){
									top.$.messager.alert('提示',msn,'info',function(){top.location='${ctx}/user-login-sys-new/loginPwd';});
									return '';
								}
							}
							return data;
						   },
						   buttons : [
						        {text:'提交申请',
								iconCls:'icon-ok',
								handler:function(){	
									top.$('#myform').form('submit', {    
									    url:"${ctx}/business/projectPause/leader/saveProjectPause?resultString=0",
									    onSubmit: function(){ 											    										
									    if (!$('#myform').form('validate')) {
									    	top.$.messager.alert('提示信息','验证没有通过,不能提交表单!','info');
											return false; //当表单验证不通过的时候 必须要return false 
										   }
									    },   
									    success:function(data){
									       if(data=="saveSuccess"){	
									    top.$.messager.alert('提示信息','提交成功!','info',function(){
									    	 top.$('#firstLevelDialog').dialog('close');
									    	$('#listProjectsTable').datagrid('reload');
									    	});									
									       $('#listProjectsTable').datagrid('reload');
											}else if(data=="reasonnull"){
											 top.$.messager.alert('提示信息','原因不为空!','info');
											}
									     
									    } 
									   
	                              });  
									}
								}
							,
							{
								text:'取消',
								iconCls:'icon-cancel',
								handler:function(){
									top.$('#firstLevelDialog').dialog('close');
							}}
							
							],
							onClose : function(){// 解决IE浏览器中无法移除object标签，导致上传插件的flash无法使用，所有的dialog都会出现问题
								top.$("#uploadify").uploadify('destroy');//销毁文件上传对象....
								top.$("#dealDeclareUpload").uploadify('destroy');//销毁文件上传对象....
								afterClosed();
							}
						});
			 		top.$('#firstLevelDialog').dialog("center");
		 }
		 
			//项目撤销
		 function projectRevoke(id,category){ 
			    $('#projectPause').dialog({
				 			title:"项目撤销",  
						    iconCls:'icon-view',
						    width: '600',    
						    height:'225',    
						    closed: false,    
						    inline : true,
						    cache: false,    
					        href: "${ctx}/business/projectPause/bizmanager/projectRevokePage?projectId="+id,
						    modal: true,
							extractor : function(data){
								if($.trim(data) == "unLogin"){
									var msn = ''||i18n[''];
									msn = msn||i18n[data];
									if(msn != undefined){
										top.$.messager.alert('提示',msn,'info',function(){top.location='${ctx}/user-login-sys-new/loginPwd';});
										return '';
									}
								}
								return data;
							   },
							   buttons : [
							        {text:'提交',
									iconCls:'icon-ok',
									handler:function(){	
										$('#myform').form('submit', {    
										    url:'${ctx}/business/projectPause/bizmanager/projectRevoke?pauseCategory='+category,
										    onSubmit: function(){ 											    										
										    if (!$('#myform').form('validate')) {
										   top.$.messager.alert('提示信息','验证没有通过,不能提交表单！','info');   	
									
												return false; //当表单验证不通过的时候 必须要return false 
											   }
										    },   
										    success:function(data){ 	 
										       if(data=="saveSuccess"){	
										top.$.messager.alert('提示信息','项目撤销成功！','info',function(){
											$('#projectPause').dialog('close');
											$('#listProjectsTable').datagrid('reload');});   										
												}
										       else if(data=="reasonnull"){
										    	   top.$.messager.alert('提示信息','撤销原因不为空！','info');  
										    	}else {
												top.$.messager.alert('提示信息','项目撤销失败！','info');   			
												}
										    }    
										        
		                              });  
										}
									
									}
								,
								{
									text:'取消',
									iconCls:'icon-cancel',
									handler:function(){
										$('#projectPause').dialog('close');
								}}
								
								],
			    
							});
				 		$('#projectPause').dialog("center");

			 }	
			
			
		 //项目重启（竞价）
	        function projectRestoreJ(id){
	     	   $('#projectPause').dialog({
			 			title:"项目重启",  
					    iconCls:'icon-view',
					    width: '600',    
					    height:'225',    
					    closed: false,    
					    inline : true,
					    cache: false,    
				        href: "${ctx}/business/projectPause/leader/toRestartPageJ?projectId="+id,
					    modal: true,
						extractor : function(data){
							if($.trim(data) == "unLogin"){
								var msn = ''||i18n[''];
								msn = msn||i18n[data];
								if(msn != undefined){
									top.$.messager.alert('提示',msn,'info',function(){top.location='${ctx}/user-login-sys-new/loginPwd';});
									return '';
								}
							}
							return data;
						   },
						   buttons : [
						        {text:'提交',
								iconCls:'icon-ok',
								handler:function(){	
									
									//加载数据loading
									loading();
									
									$('#myform').form('submit', {    
									    url:'${ctx}/business/projectPause/leader/projectRestoreJ?result=3&pauseCategory=0',
									    onSubmit: function(){ 											    										
									    if (!$('#myform').form('validate')) {
									 //  top.$.messager.alert('提示','选择时间有误,请重新选择!','info');   		
									  		 top.$('#secondtLevelDialog').dialog('close');//关闭加载数据
											return false; //当表单验证不通过的时候 必须要return false 
										   }
									    },   
									    success:function(data){
									       if(data=="saveSuccess"){	
									    	   top.$('#secondtLevelDialog').dialog('close');//关闭加载数据
									    	   $.messager.alert('提示信息','项目重启成功！','info',function(){
									    		   top.$('#secondtLevelDialog').dialog('close');//关闭加载数据
									    		   window.location.reload();
									    		   }); 
									       }else if(data=="saveUnsuccess"){
									    	   top.$('#secondtLevelDialog').dialog('close');//关闭加载数据
											   $.messager.alert('提示信息','开标时间维护推送至银行失败，请联系系统管理员！','error');
									       }
											 else{
												 top.$('#secondtLevelDialog').dialog('close');//关闭加载数据
											   $.messager.alert('提示信息','新投标时间需晚于旧投标时间和当前时间！','error');
											}
									    }    
	                          });  
									}
								
								}
							,
							{
								text:'取消',
								iconCls:'icon-cancel',
								handler:function(){
									$('#projectPause').dialog('close');
							}}
							
							],
		    
						});
			 		$('#projectPause').dialog("center");
		       
			 }
		 
	        //项目重启(中标)
	        function projectRestoreZ(id){
	     	   $('#projectPause').dialog({
			 			title:"项目重启",  
					    iconCls:'icon-view',
					    width: '600',    
					    height:'225',    
					    closed: false,    
					    inline : true,
					    cache: false,    
				        href: "${ctx}/business/projectPause/leader/toRestartPageZ?projectId="+id,
					    modal: true,
						extractor : function(data){
							if($.trim(data) == "unLogin"){
								var msn = ''||i18n[''];
								msn = msn||i18n[data];
								if(msn != undefined){
									top.$.messager.alert('提示',msn,'info',function(){top.location='${ctx}/user-login-sys-new/loginPwd';});
									return '';
								}
							}
							return data;
						   },
						   buttons : [
						        {text:'提交',
								iconCls:'icon-ok',
								handler:function(){	
									$('#myform').form('submit', {    
									    url:'${ctx}/business/projectPause/leader/projectRestoreZ?result=3&pauseCategory=1',
									    onSubmit: function(){ 											    										
									    if (!$('#myform').form('validate')) {	
									    top.$.messager.alert('提示信息','验证没有通过,不能提交表单！','error');
										/*	$.messager.show({
												title : '提示信息',
												msg : '验证没有通过,不能提交表单!'
											});*/
											return false; //当表单验证不通过的时候 必须要return false 
										   }
									    },   
									    success:function(data){
									       if(data=="saveSuccess"){	
									    	  top.$.messager.alert('提示信息','项目重启成功！','info',function(){
									    		  window.location.reload();  }); 
									    	  }
											 else{
											   $.messager.alert('提示信息','新公示时间需晚于旧公示时间和当前时间！','info');
											}
									     // $('#projectPause').dialog('close');
									     
									    }    
	                          });  
									}
								
								}
							,
							{
								text:'取消',
								iconCls:'icon-cancel',
								handler:function(){
									$('#projectPause').dialog('close');
							}}
							
							],
		    
						});
			 		$('#projectPause').dialog("center");
		       
			 }
		 
	        //流标
	        function projectFlow(id,category){
	        	   $('#projectPause').dialog({
			 			title:"项目流标",  
					    iconCls:'icon-view',
					    width: '600',    
					    height:'225',    
					    closed: false,    
					    inline : true,
					    cache: false,    
				        href: "${ctx}/business/projectPause/bizmanager/projectFlowPage?projectId="+id,
					    modal: true,
						extractor : function(data){
							if($.trim(data) == "unLogin"){
								var msn = ''||i18n[''];
								msn = msn||i18n[data];
								if(msn != undefined){
									top.$.messager.alert('提示',msn,'info',function(){top.location='${ctx}/user-login-sys-new/loginPwd';});
									return '';
								}
							}
							return data;
						   },
						   buttons : [
						        {text:'提交',
								iconCls:'icon-ok',
								handler:function(){	
									$('#myform').form('submit', {    
									    url:'${ctx}/business/projectPause/bizmanager/projectFlow?pauseCategory='+category,
									    onSubmit: function(){ 											    										
									    if (!$('#myform').form('validate')) {
									     top.$.messager.alert('提示信息','验证没有通过,不能提交表单！','error');
											/*$.messager.show({
												title : '提示信息',
												msg : '验证没有通过,不能提交表单!'
											});*/
											return false; //当表单验证不通过的时候 必须要return false 
										   }
									    },   
									    success:function(data){
									       if(data=="saveSuccess"){	
									    top.$.messager.alert('提示信息','流标操作成功！！','info');
									     
									     /*  $.messager.show({
												title : '提示信息',
												msg : '流标操作成功！'
											  });  */
											} else{
										top.$.messager.alert('提示信息','流标操作失败！','info');		
											  /*  $.messager.show({
												title : '提示信息',
												msg : '流标操作失败！'
											  });  */
											}
									      $('#projectPause').dialog('close');
									      $(function(){
	                                          setTimeout(function () { window.location.reload();},1000);
	                                         });   
									    }    
	                             });  
									}
								
								}
							,
							{
								text:'取消',
								iconCls:'icon-cancel',
								handler:function(){
									$('#projectPause').dialog('close');
							}}
							
							],
		    
						});
			 		$('#projectPause').dialog("center");
		       
			 }
	    
	        
	      //关闭
			function afterClosed(){
				// 在弹出对话框内找到Uploadify插件，并隐藏之。
	             top.$.find('.upload').hide();
				// 将弹出对话框还原成弹出前的状态，并清空里面的内容。
				top.$('#firstLevelDialog').dialog('destroy').empty();
				}
		
			//加载数据loading
			 function loading(){
					top.$('#secondtLevelDialog').dialog({
					closable: false,
				    title:'数据加载',
				    width: '300',    
				    height: '180',    
				    closed: false,    
				    inline : true,
				    cache: false,    
				    href: "${ctx}/commons/js/loading/loading.html",
				    modal: true,
					extractor : function(data){
						if($.trim(data) == "unLogin"){
							var msn = ''||i18n[''];
							msn = msn||i18n[data];
							if(msn != undefined){
								top.$.messager.alert('提示',msn,'info',function(){top.location='${ctx}/user-login-sys-new/loginPwd';});
								return '';
							}
						}
						return data;
					}
					});
					top.$('#secondtLevelDialog').dialog("center");
				}
	   		
			
			
	 	/*
		*查看结果(中标/流标结果)
		*/
		function viewNotifyResult(id){
			top.$('#firstLevelDialog').dialog({
	 			title:"查看结果",  
			    iconCls:'icon-view',
			    width: '1000',    
			    height: '600',    
			    closed: false,    
			    inline : true,
			    cache: false,    
			    href:  "${ctx}/business/projectmanage/buyer/viewNotifyResult?projectId="+id,
			    modal: true,
			    close: afterClosed,
				extractor : function(data){
					if($.trim(data) == "unLogin"){
						var msn = ''||i18n[''];
						msn = msn||i18n[data];
						if(msn != undefined){
							top.$.messager.alert('提示',msn,'info',function(){top.location='${ctx}/user-login-sys-new/loginPwd';});
							return '';
						}
					}
					return data;
				   },
				   buttons : [
					{
						text:'取消',
						iconCls:'icon-cancel',
						handler:function(){
							top.$('#firstLevelDialog').dialog('close');
					}}],
    
				});
	 		top.$('#firstLevelDialog').dialog("center");
		}
	 	
	 	
		/*
		* 中标确认操作
		**/
		function hitConfirm(id){
			top.$('#firstLevelDialog').dialog({
	 			title:"中心确认",
			    iconCls:'icon-view',
			    width: '600',    
			    height: '300',    
			    closed: false,    
			    inline : true,
			    cache: false,    
			    href: "${ctx}/business/projectNb/centerAuditor/hitConfirm?projectId="+id,   
			    modal: true,
				extractor : function(data){
					if($.trim(data) == "unLogin"){
						var msn = ''||i18n[''];
						msn = msn||i18n[data];
						if(msn != undefined){
							top.$.messager.alert('提示',msn,'info',function(){top.location='${ctx}/user-login-sys-new/loginPwd';});
							return '';
						}
					}
					return data;
				},
			    buttons : [{text:'提交',
			            id:'commitEntityBt',
						iconCls:'icon-ok',
						handler:function(){
							//获取表单数据
							var cancelReason=top.$("#cancelReason").val();
							if(cancelReason==""&&!top.$("#auditPass").is(':checked')){
								top.$.messager.alert("提示",'请输入原因!',"error");
								return;
							}
							loadinginfo();//显示加载框
							top.$('#commitEntityBt').linkbutton('disable');
								$.ajax({
									type : "post",
									url : "${ctx}/business/projectNb/centerAuditor/doSubmitHitConfirm?r="+new Date().getTime(),
									data : top.$("#projectsDataForm").serialize(),
									success : function(data){
										debugger
										top.$('#secondtLevelDialog').dialog('close');//隐藏加载框
										if(data=="success"){
											top.$.messager.alert("提示",'提交成功','info',function(){
												$('#listProjectsTable').datagrid('reload');
												$('#listNBProjectsTable').datagrid('reload');
												top.$('#firstLevelDialog').dialog('close');
											});
										}else if(data =="postbanexecutekfaill"){
											top.$.messager.alert('提示',"推送履约保证金信息至银行失败，请联系系统管理员！",'error');
											$('#listProjectsTable').datagrid('reload');
											top.$('#firstLevelDialog').dialog('close');
										}else{
											top.$.messager.alert("提示",'提交失败!',"error");
										}
									},
									error : function(data){
										top.$('#secondtLevelDialog').dialog('close');//隐藏加载框
										top.$.messager.alert("提示",'提交失败!',"error");
									}
								});
							}
						}
					,{
						text:'取消',
						iconCls:'icon-cancel',
						handler:function(){
							top.$('#firstLevelDialog').dialog('close');
						}}]
			});
			top.$('#firstLevelDialog').dialog("center");
		}
		
		
		/*
		* 流标确认操作
		**/
		function flowConfirm(id){
			 $.messager.confirm('提示',"您确认结果吗？",function(result){
				 if(result){
					loading();
					 $.ajax({
							type: "post",
							url:  "${ctx}/business/projectNb/centerAuditor/doSubmitFlowConfirm?projectId="+id,
							success: function(data,res){
								top.$('#secondtLevelDialog').dialog('close');//关闭加载数据
								var result = $.trim(res.responseText);
								if(result == "unLogin"){
									var msn = ''||i18n[''];
									msn = msn||i18n[result];
									if(msn != undefined){
										top.$.messager.alert('提示',msn,'info',function(){top.location='${ctx}/user-login-sys-new/loginPwd';});
										return ;
									}
								}
								if(data=="success"){
									top.$.messager.alert("提示",'操作成功!','info',function(){
										$('#listProjectsTable').datagrid('reload');
									});
								}
							},
							error: function(res){
								top.$('#secondtLevelDialog').dialog('close');//关闭加载数据
								$.messager.alert('提示',i18n.requestError,'error');
							}
						});
				 }
			 });
		}
		
		/**
		 * 发放中标通知书
		 */
		 function noticBidInfo(id){
			 top.$.messager.confirm('提示',"您确认要发放本项目中标通知书、项目合同吗？",function(result){
				 if(result){
					 $.ajax({
							type: "post",
							url:  "${ctx}/business/projectNb/centerAuditor/noticBidInfo?id="+id,
							success: function(data,res){
								var result = $.trim(res.responseText);
								if(result == "unLogin"){
									var msn = ''||i18n[''];
									msn = msn||i18n[result];
									if(msn != undefined){
										top.$.messager.alert('提示',msn,'info',function(){top.location='${ctx}/user-login-sys-new/loginPwd';});
										return ;
									}
								}
								top.$.messager.alert("提示",'请联系财务管理员于5个工作日内退还非中标人投标保证金!','info',function(){
									$('#listProjectsTable').datagrid('reload');
								});
								
							},
							error: function(res){
								$.messager.alert('提示',i18n.requestError,'error');
							}
						});
				 }
			 });
		 }
		
		 /**打印中标通知书**/
		function printWinbidAlert(id){
			top.$('#firstLevelDialog').dialog({
	 			title:"中标通知书",  
			    iconCls:'icon-view',
			    width: '665',    
			    height:'325',    
			    closed: false,    
			    inline : true,
			    cache: false,    
			    href:  "${ctx}/business/projectNb/printWinbidAlert?projectId="+id+"&isShow=false",
			    modal: true,
			    close: afterClosed,
				extractor : function(data){
					if($.trim(data) == "unLogin"){
						var msn = ''||i18n[''];
						msn = msn||i18n[data];
						if(msn != undefined){
							top.$.messager.alert('提示',msn,'info',function(){top.location='${ctx}/user-login-sys-new/loginPwd';});
							return '';
						}
					}
					return data;
				   },
				   buttons : [{
						text:'取消',
						iconCls:'icon-cancel',
						handler:function(){
							top.$('#firstLevelDialog').dialog('close');
					}}],
    
			});
	 		top.$('#firstLevelDialog').dialog("center");
		}
		 
		/**
		*合同审核页面
		*/
		function contractAudit(id){
			top.$('#firstLevelDialog').dialog({
	 			title:"合同审核",  
			    iconCls:'icon-view',
			    width: '600',    
			    height: '300',    
			    closed: false,    
			    inline : true,
			    cache: false,    
			    href: "${ctx}/business/projectNb/centerAuditor/contractAuditInput?projectId="+id,   
			    modal: true,
				extractor : function(data){
					if($.trim(data) == "unLogin"){
						var msn = ''||i18n[''];
						msn = msn||i18n[data];
						if(msn != undefined){
							top.$.messager.alert('提示',msn,'info',function(){top.location='${ctx}/user-login-sys-new/loginPwd';});
							return '';
						}
					}
					return data;
				},
			    buttons : [{text:'提交',
			            id:'commitEntityBt',
						iconCls:'icon-ok',
						handler:function(){
							//获取表单数据
							debugger;
							var cancelReason=top.$("#cancelReason").val();
							if(cancelReason==""&&!top.$("#auditPass").is(':checked')){
								top.$.messager.alert("提示",'请输入原因!',"error");
								return;
							}
							loadinginfo();//显示加载框
							top.$('#commitEntityBt').linkbutton('disable');
								$.ajax({
									type : "post",
									url : "${ctx}/business/projectNb/centerAuditor/contractAudit?r="+new Date().getTime(),
									data : top.$("#projectsDataForm").serialize(),
									success : function(data){
										debugger
										top.$('#secondtLevelDialog').dialog('close');//隐藏加载框
										if(data=="success"){
											top.$.messager.alert("提示",'提交成功','info',function(){
												$('#listProjectsTable').datagrid('reload');
												$('#listNBProjectsTable').datagrid('reload');
												top.$('#firstLevelDialog').dialog('close');
											});
										}else{
											top.$.messager.alert("提示",'提交失败!',"error");
										}
									},
									error : function(data){
										top.$('#secondtLevelDialog').dialog('close');//隐藏加载框
										top.$.messager.alert("提示",'提交失败!',"error");
									}
								});
							}
						}
					,{
						text:'取消',
						iconCls:'icon-cancel',
						handler:function(){
							top.$('#firstLevelDialog').dialog('close');
						}}]
			});
			top.$('#firstLevelDialog').dialog("center");
		}
		
		
		
		/**
		*验收报告审核页面
		*/
		function receivingReportAudit(id){
			top.$('#firstLevelDialog').dialog({
	 			title:"验收报告审核",  
			    iconCls:'icon-view',
			    width: '600',    
			    height: '300',    
			    closed: false,    
			    inline : true,
			    cache: false,    
			    href: "${ctx}/business/projectNb/centerAuditor/receivingReportAuditInput?projectId="+id,   
			    modal: true,
				extractor : function(data){
					if($.trim(data) == "unLogin"){
						var msn = ''||i18n[''];
						msn = msn||i18n[data];
						if(msn != undefined){
							top.$.messager.alert('提示',msn,'info',function(){top.location='${ctx}/user-login-sys-new/loginPwd';});
							return '';
						}
					}
					return data;
				},
			    buttons : [{text:'提交',
			            id:'commitEntityBt',
						iconCls:'icon-ok',
						handler:function(){
							//获取表单数据
							debugger;
							var cancelReason=top.$("#cancelReason").val();
							if(cancelReason==""&&!top.$("#auditPass").is(':checked')){
								top.$.messager.alert("提示",'请输入原因!',"error");
								return;
							}
							loadinginfo();//显示加载框
							top.$('#commitEntityBt').linkbutton('disable');
								$.ajax({
									type : "post",
									url : "${ctx}/business/projectNb/centerAuditor/receivingReportAudit?r="+new Date().getTime(),
									data : top.$("#projectsDataForm").serialize(),
									success : function(data){
										debugger
										top.$('#secondtLevelDialog').dialog('close');//隐藏加载框
										if(data=="success"){
											top.$.messager.alert("提示",'提交成功','info',function(){
												$('#listProjectsTable').datagrid('reload');
												$('#listNBProjectsTable').datagrid('reload');
												top.$('#firstLevelDialog').dialog('close');
											});
										}else{
											top.$.messager.alert("提示",'提交失败!',"error");
										}
									},
									error : function(data){
										top.$('#secondtLevelDialog').dialog('close');//隐藏加载框
										top.$.messager.alert("提示",'提交失败!',"error");
									}
								});
							}
						}
					,{
						text:'取消',
						iconCls:'icon-cancel',
						handler:function(){
							top.$('#firstLevelDialog').dialog('close');
						}}]
			});
			top.$('#firstLevelDialog').dialog("center");
		}
		
		
		/**
		 * 结项操作
		 */
		 function endProject(id){
			 $.messager.confirm('提示',"您确定要结束项目吗？",function(result){
				 if(result){
					 $.ajax({
							type: "post",
							url:  "${ctx}/business/projectNb/centerAuditor/endProject?projectId="+id,
							success: function(data,res){
								var result = $.trim(res.responseText);
								if(result == "unLogin"){
									var msn = ''||i18n[''];
									msn = msn||i18n[result];
									if(msn != undefined){
										top.$.messager.alert('提示',msn,'info',function(){top.location='${ctx}/user-login-sys-new/loginPwd';});
										return ;
									}
								}
								top.$.messager.alert("提示",'操作成功!','info',function(){
									$('#listProjectsTable').datagrid('reload');
								});
								
							},
							error: function(res){
								$.messager.alert('提示',i18n.requestError,'error');
							}
						});
				 }
			 });
		 }
		
		
		 /**
		 *质疑投诉
		 */
		 function oppugn(id){
			 top.$('#firstLevelDialog').dialog({
		 			title:"质疑投诉",  
				    iconCls:'icon-view',
				    width: '900',    
				    height:'500',    
				    closed: false,    
				    inline : true,
				    cache: false,    
				    href: "${ctx}/business/projectmanage/leader/oppugnInput?id="+id,
				    modal: true,
				    close: afterClosed,
					extractor : function(data){
						if($.trim(data) == "unLogin"){
							var msn = ''||i18n[''];
							msn = msn||i18n[data];
							if(msn != undefined){
								top.$.messager.alert('提示',msn,'info',function(){top.location='${ctx}/user-login-sys-new/loginPwd';});
								return '';
							}
						}
						return data;
					},
					buttons :
						[{text:'提交',
							iconCls:'icon-ok',
							handler:function(){
								var contentMsg=top.getEditorHTMLContents();
								if(contentMsg==''){
									top.$.messager.alert('提示',"请输入内容",'error');
									return false;
								}
								if(top.$('#addContentDataForm').form('validate')){//表单校验是否通过
									//获取富文本中的文字									
									top.$('#contentMsg').val(top.getEditorHTMLContents());
									$.ajax({
										type: "post",
										url:  "${ctx}/business/webcontent/save",
										data:top.$('#addContentDataForm').serialize(),
										success: function(data,res){
											var result = $.trim(res.responseText);
											if(result == "unLogin"){
												var msn = ''||i18n[''];
												msn = msn||i18n[result];
												if(msn != undefined){
													top.$.messager.alert('提示',msn,'info',function(){top.location='${ctx}/user-login-sys-new/loginPwd';});
													return ;
												}
											}
											top.$.messager.alert("提示",'操作成功!','info',function(){
												$('#listProjectsTable').datagrid('reload');
											});
											
										},
										error: function(res){
											$.messager.alert('提示',i18n.requestError,'error');
										}
									});
									top.$('#firstLevelDialog').dialog('close');
								}
							}
						},{
							text:'取消',
							iconCls:'icon-cancel',
							handler:function(){
								top.$('#firstLevelDialog').dialog('close');
							}}],
							onClose : function(){// 解决IE浏览器中无法移除object标签，导致上传插件的flash无法使用，所有的dialog都会出现问题
								top.$("#uploadify").uploadify('destroy');//销毁文件上传对象....
								afterClosed();
							}
			});
		 		top.$('#firstLevelDialog').dialog("center");
		 }
		 
		 
		 /**
			*项目详情
			*/
		function getProjectDetail(id){
				top.$('#firstLevelDialog').dialog({    
				    title:"项目详情",  
				    iconCls:'icon-view',
				    width: 1000,    
				    height: 580,    
				    closed: false,    
				    inline : true,
				    cache: false,    
				    href: "${ctx}/business/projectmanage/getProjectDetail?projectId=" + id+"&roleId=centerAuditor",
				    modal: true,
					extractor : function(data){
						if($.trim(data) == "unLogin"){
							var msn = ''||i18n[''];
							msn = msn||i18n[data];
							if(msn != undefined){
								top.$.messager.alert('提示',msn,'info',function(){top.location='${ctx}/user-login-sys-new/loginPwd';});
								return '';
							}
						}
						return data;
					},
				    buttons : [{
							text:projectsParamObj.cancelButton,
							iconCls:'icon-cancel',
							handler:function(){
								top.$('#firstLevelDialog').dialog('close');
							}}]
				});
				top.$('#'+projectsParamObj.showDialogId).dialog("center");
			}
		 
			 //变更公告
	   		 function editPublish(id){
	   			 top.$('#firstLevelDialog').dialog({
	   		 			title:"变更公告",  
	   				    iconCls:'icon-view',
	   				    width: '900',    
	   				    height:'500',    
	   				    closed: false,    
	   				    inline : true,
	   				    cache: false,    
	   				    href: "${ctx}/business/projectmanage/leader/editPublish?projectId="+id,
	   				    modal: true,
	   				    close: afterClosed,
	   					extractor : function(data){
	   						if($.trim(data) == "unLogin"){
	   							var msn = ''||i18n[''];
	   							msn = msn||i18n[data];
	   							if(msn != undefined){
	   								top.$.messager.alert('提示',msn,'info',function(){top.location='${ctx}/user-login-sys-new/loginPwd';});
	   								return '';
	   							}
	   						}
	   						return data;
	   					},
	   					buttons :
	   						[{text:'提交',
	   							iconCls:'icon-ok',
	   							handler:function(){
	   								if(top.$('#addContentDataForm').form('validate')){//表单校验是否通过
	   									//获取富文本中的文字									
	   									top.$('#contentMsg').val(top.getEditorHTMLContents());
	   									$.ajax({
	   										type: "post",
	   										url:  "${ctx}/business/webcontent/save",
	   										data:top.$('#addContentDataForm').serialize(),
	   										success: function(data,res){
	   											var result = $.trim(res.responseText);
	   											if(result == "unLogin"){
	   												var msn = ''||i18n[''];
	   												msn = msn||i18n[result];
	   												if(msn != undefined){
	   													top.$.messager.alert('提示',msn,'info',function(){top.location='${ctx}/user-login-sys-new/loginPwd';});
	   													return ;
	   												}
	   											}
	   											top.$.messager.alert("提示",'操作成功!','info',function(){
	   												$('#listProjectsTable').datagrid('reload');
	   											});
	   											
	   										},
	   										error: function(res){
	   											$.messager.alert('提示',i18n.requestError,'error');
	   										}
	   									});
	   									top.$('#firstLevelDialog').dialog('close');
	   								}
	   							}
	   						},{
	   							text:'取消',
	   							iconCls:'icon-cancel',
	   							handler:function(){
	   								top.$('#firstLevelDialog').dialog('close');
	   							}}],
	   							onClose : function(){// 解决IE浏览器中无法移除object标签，导致上传插件的flash无法使用，所有的dialog都会出现问题
	   								top.$("#uploadify").uploadify('destroy');//销毁文件上传对象....
	   								afterClosed();
	   							}
	   			});
	   		 		top.$('#firstLevelDialog').dialog("center");
	   		 }
			 
			 
	   		/**
		   		* 评标之后补录评标过程的资料
		   		*/
		   		function supplementFile(id){
		   			top.$('#firstLevelDialog').dialog({
	   		 			title:"补录资料",  
	   				    iconCls:'icon-view',
	   				    width: '900',    
	   				    height:'500',    
	   				    closed: false,    
	   				    inline : true,
	   				    cache: false,    
	   				    href: "${ctx}/business/projectNb/supplementFile?projectId="+id,
		   				modal: true,
		 			    close: afterClosed,
		 				extractor : function(data){
		 					if($.trim(data) == "unLogin"){
		 						var msn = ''||i18n[''];
		 						msn = msn||i18n[data];
		 						if(msn != undefined){
		 							top.$.messager.alert('提示',msn,'info',function(){top.location='${ctx}/user-login-sys-new/loginPwd';});
		 							return '';
		 						}
		 					}
		 					return data;
		 				},
		 			    buttons : [{
		 						text:'提交',
		 						iconCls:'icon-ok',
		 						handler:function(){
		 							if(top.$('#addDataForm').form('validate')){//表单校验是否通过
		 								//alert("提交按钮操作");
		 								$.ajax({
		 									type : "post",
		 									url : "${ctx}/business/projectNb/doSupplementFile?r="+new Date().getTime(),
		 									data : top.$("#addDataForm").serialize(),
		 									success : function(data){
		 										if(data=="success"){
		 											//top.$(".upload").uploadify('destroy');//销毁文件上传对象....
		 												top.$.messager.alert("提示",'提交成功','info',function(){
		 													$('#listProjectsTable').datagrid('reload');
		 													top.$('#firstLevelDialog').dialog('close');
		 												});
		 										}
		 										else{
		 											top.$.messager.alert("提示",'提交失败!',"error");
		 										}
		 									},
		 								error : function(data){
		 										top.$.messager.alert("提示",'提交失败!',"error");
		 								}
		 								});
		 							}
		 							
		 						}},
		 						{
		 							text:'取消',
		 							iconCls:'icon-cancel',
		 							handler:function(){
		 								top.$('#firstLevelDialog').dialog('close');
		 							}}],
		 						onClose : function(){// 解决IE浏览器中无法移除object标签，导致上传插件的flash无法使用，所有的dialog都会出现问题
		 							top.$(".uploadify").each(function() {
		 								var uploadId=$(this).parent().parent().find(".uploadify").attr("id");
		 								top.$("#"+uploadId).uploadify('destroy');//销毁文件上传对象....
		 							});
		 							afterClosed();
		 						}
		 				});
		 	 		top.$('#firstLevelDialog').dialog("center");
		   		}


        /**
         * 打开归档资料选择页面
         */
        function pigeonhole(id){//
            top.$('#firstLevelDialog').dialog({
                title:"归档操作",
                iconCls:'icon-view',
                width: '665',
                height:'525',
                closed: false,
                inline : true,
                cache: false,
                href:  "${ctx}/business/projectNb/leader/pigeonholeInput?projectId="+id,
                modal: true,
                close: afterClosed,
                extractor : function(data){
                    if($.trim(data) == "unLogin"){
                        var msn = ''||i18n[''];
                        msn = msn||i18n[data];
                        if(msn != undefined){
                            top.$.messager.alert('提示',msn,'info',function(){top.location='${ctx}/user-login-sys-new/loginPwd';});
                            return '';
                        }
                    }
                    return data;
                },
                buttons : [
                    {text:'一键导出',
                        iconCls:'icon-ok',
                        handler:function(){
                            top.$("#pigeonholeForm").submit();
                            top.$('#firstLevelDialog').dialog('close');

                        }

                    }
                    ,
                    {
                        text:'取消',
                        iconCls:'icon-cancel',
                        handler:function(){
                            top.$('#firstLevelDialog').dialog('close');
                        }}],

            });
            top.$('#firstLevelDialog').dialog("center");
        }


	</script>